import Taro, { Component } from '@tarojs/taro'
import { View, Text, Navigator, Button } from '@tarojs/components'
// import NongBankIcon from '../../images/bank/2.png'  这个
import './NeedItem.scss'
export default class NeedItem extends Component {

  render () {
    let {name,category,price,time,btnType,url} = this.props //获取父组件传递过来的对象（url、title、time）

    return (
      <View className="NeedItem">
        <View className='NeedItem_top_wrap'></View>
        <View className='NeedItem_name_warp'>
        <View className='NeedItem_name'>{name}</View>
          <View className='NeedItem_category'>{category}</View>
        </View>
        <View className='NeedItem_price_wrap'>{price}</View>
        <View className='NeedItem_line_wrap'>
          <View className='NeedItem_line_side_left'></View>
          <View className='NeedItem_line'></View>
          <View className='NeedItem_line_side_right'></View>
        </View>
        <View className='NeedItem_time_wrap'>
          <View className='NeedItem_time'>{time}</View>
          {
            btnType==='seeMore'
            ?<Navigator url={url} className='NeedItem_btn_see_more'>查看详情</Navigator>
            :<Navigator url={url} className='NeedItem_btn_select_product'>选择产品</Navigator>
          }
        </View>
        <View className='NeedItem_bottom_wrap'></View>
      </View>
    )
  }
}
